package PMB.handler;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.dbutils.ResultSetHandler;

import bean.User;
import bean.idetification;
import bean.receiverMsg;

public class IdentifiResultSetHandler implements ResultSetHandler<List<idetification>> {

	@Override
	public List<idetification> handle(ResultSet resultSet) throws SQLException {
		List<idetification> list=new ArrayList<>();
		while (resultSet.next()) {
			idetification dinfo=new idetification();
			
			dinfo.setId(resultSet.getInt("id"));
			dinfo.setUserId(resultSet.getInt("userId"));
			dinfo.setImg1(resultSet.getString("img1"));
			dinfo.setImg2(resultSet.getString("img2"));
			dinfo.setImg3(resultSet.getString("img3"));
			dinfo.setImg4(resultSet.getString("img4"));
			dinfo.setRealName(resultSet.getString("realName"));
			dinfo.setIdNumber(resultSet.getString("idNumber"));
			dinfo.setCreateTime(resultSet.getString("createTime"));
			dinfo.setState(resultSet.getInt("state"));
			dinfo.setHttp(resultSet.getString("http"));
			
			User uinfo=new User();
			uinfo.setUserid(resultSet.getInt("userId"));
			uinfo.setUserName(resultSet.getString("userName"));
			uinfo.setSex(resultSet.getString("sex"));
			
			dinfo.setUinfo(uinfo);
			list.add(dinfo);
		}	
		return list;
			
	}

}
